#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>    

#include <string.h>

#include <assert.h>

void* my_memcpy(void* dest, const void* src, size_t num)

{

	void* temp = dest;

	assert(dest && src);

	while (num--)

	{

		*(char*)dest = *(char*)src;

		(char*)dest = (char*)dest + 1;

		(char*)src = (char*)src + 1;

	}

	return temp;

}



int main()

{

	char arr1[] = "abcdefgh";

	char arr2[] = "eflisjnd";

	my_memcpy(arr1, arr2, 5);

	printf("%s\n", arr1);

	return 0;

}